<html>
<head>
<!-- CSS goes in the document HEAD or added to your external stylesheet -->
<link rel="stylesheet" href="styles/staff.css" type="text/css" />

</head>
<body>



<?php
require("model/connect.php");

$baitren_mottrang = 10;

if ( !isset($_GET['page']) )
{
    $page = 0 ;

}else
{
    $page= $_GET['page'];
}
$sodu_lieu = mysql_num_rows(mysql_query("SELECT * FROM `trainningprogram` ") ) or die(mysql_error());

$sotrang = $sodu_lieu/$baitren_mottrang;

$result =mysql_query("SELECT * FROM `trainningprogram` LIMIT ".$page*$baitren_mottrang.",".$baitren_mottrang) or die(mysql_error());
?>
<table class="gridtable">
<tr>
	<th>Mã khóa học</th><th>Tên khóa học</th><th>Ngày bắt đầu khóa học</th><th>Mở lớp</th>
</tr>
<?php
while ( $info = mysql_fetch_array($result )) 
{
    ?>
<tr>
	<td><?php echo $info[0].""  ?></td><td><?php echo $info[1].""  ?></td><td><?php echo $info[2].""  ?></td><td><?php echo "<a href=\"staff-index.php?p=staff-list-course&idtrainningpro={$info[0]}\">Mở lớp cho ngành này</a>"  ?></td>
</tr>
    <?php
}
?>
</table>
<?php
for ( $page = 0; $page < $sotrang; $page ++ )
{
echo "<a href='staff-index.php?p=staff-list-trainning-program&page={$page}'>{$page} </a>";
} 

mysql_close();
?>
</body>
</html>

